<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">

    {if $pid>0}
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('父级')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-pid" data-rule="required" min="0" data-source="/user/user/questioncategory/search" {$pid_data_params} class="form-control selectpage" name="row[pid]" type="text" value="{$pid}">
        </div>
    </div>
    {/if}

    <div class="form-group" style="display: none">
        <label class="control-label col-xs-12 col-sm-2">{:__('题库')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-course_id" readonly data-rule="required" min="0"  class="form-control " name="row[course_id]" type="hidden" value="{$course_id}">
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('名称')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-name" data-rule="required" class="form-control" name="row[name]" type="text" value="">
        </div>
    </div>


    <div class="form-group" style="display: none">
        <label class="control-label col-xs-12 col-sm-2">{:__('图标')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-icon" readonly data-rule="required"   class="form-control " name="row[icon]" type="hidden" value="cuIcon-post">
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('排序')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-weigh" data-rule="required" min="0" class="form-control" name="row[weigh]" type="number" value="0">
        </div>
    </div>

    {if !$pid}
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('分类类型')}:</label>
        <div class="col-xs-12 col-sm-8">
            {:build_radios('row[is_multi_level]', ['0'=>__('普通分类(仅支持一级分类)'), '1'=>__('多级分类(支持如章节类分类)')],0)}
        </div>
    </div>
    {/if}

    <div class="form-group" style="display: none">
        <label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
        <div class="col-xs-12 col-sm-8">
            {:build_radios('row[status]', ['1'=>__('启用'), '2'=>__('关闭')],1)}
        </div>
    </div>
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>
